<html>
<head>
<style>
@page {
  size: 140px 80px;
  margin: 10px;
  -fs-max-overflow-pages: 10;
  -fs-overflow-pages-direction: ltr;
}
body {
  margin: 0;
}
table {
  border: 1px solid black;
  background-color: red;
  min-height: 20px;
  -fs-table-paginate: paginate;
}
td {
  min-height: 15px;
  min-width: 50px;
  box-sizing: border-box;
}
th {
  min-height: 5px;
}
</style>
</head>
<body>
<!-- Table header and footer appear on all four pages (two real, two shadow). First real and shadow contain first two body rows and next real
     and shadow contain next two body rows.  -->
<table>
  <thead><tr><th style="background-color: pink;"></th><th style="background-color: blue;"></th><th style="background-color: orange;"></th></tr></thead>
  <tbody>
    <tr><td style="background-color: blue;"></td><td style="background-color: orange;"></td><td style="background-color: pink;"></td></tr>
    <tr><td style="background-color: blue;"></td><td style="background-color: orange;"></td><td style="background-color: pink;"></td></tr>
    <tr><td style="background-color: blue;"></td><td style="background-color: orange;"></td><td style="background-color: pink;"></td></tr>
    <tr><td style="background-color: blue;"></td><td style="background-color: orange;"></td><td style="background-color: pink;"></td></tr>
  </tbody>
  <tfoot>
    <tr><th style="background-color: pink;"></th><th style="background-color: blue;"></th><th style="background-color: orange;"></th></tr>
  </tfoot>
</table>
</body>
</html>
